class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.u: A = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.y: D = None
        self.o: E = None
        self.z: A = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

i = A("i")
j = B("j")
d = C("d")
l = D("l")
c = E("c")
g = F("g")
f = G("f")

i.x = f
j.w = d
j.r = l
d.r = i
d.u = i
d.t = i
d.p = l
d.o = g
l.q = g
l.s = j
l.x = c
l.t = d
c.x = l
g.x = f
g.u = l
g.r = c
g.o = i
f.t = c
f.o = c
f.p = c
f.q = g
f.y = l
f.z = i
f.r = d
assert c.x.t.u.x.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.u: A = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.y: D = None
        self.o: E = None
        self.z: A = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

i = A("i")
j = B("j")
d = C("d")
l = D("l")
c = E("c")
g = F("g")
f = G("f")

i.x = f
j.w = d
j.r = l
d.r = i
d.u = i
d.t = i
d.p = l
d.o = g
l.q = g
l.s = j
l.x = c
l.t = d
c.x = l
g.x = f
g.u = l
g.r = c
g.o = i
f.t = c
f.o = c
f.p = c
f.q = g
f.y = l
f.z = i
f.r = d
assert c.x.t.u.x.q.r.txt == "c"