class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.p: C = None
        self.u: B = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

c = A("c")
g = B("g")
l = C("l")
k = D("k")
e = E("e")
j = F("j")
i = D("i")

c.r = i
c.y = l
g.z = j
l.y = k
l.u = e
l.p = j
l.q = g
k.p = g
e.r = g
e.x = l
e.u = c
e.p = j
j.q = l
j.s = l
j.p = l
j.u = g
j.x = g
j.t = i
i.p = g
assert i.p.z.x.z.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.p: C = None
        self.u: B = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

c = A("c")
g = B("g")
l = C("l")
k = D("k")
e = E("e")
j = F("j")
i = D("i")

c.r = i
c.y = l
g.z = j
l.y = k
l.u = e
l.p = j
l.q = g
k.p = g
e.r = g
e.x = l
e.u = c
e.p = j
j.q = l
j.s = l
j.p = l
j.u = g
j.x = g
j.t = i
i.p = g
assert i.p.z.x.z.t.p.txt == "g"