class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.v: B = None
        self.u: C = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

b.y = g
b.o = f
b.q = f
b.v = a
b.s = a
b.u = l
j.t = a
j.o = f
l.y = c
f.y = g
f.s = k
c.s = b
c.x = k
c.t = g
k.r = e
k.x = c
k.v = f
a.t = j
a.o = f
e.r = k
e.x = g
e.v = f
g.s = b
g.x = e
g.t = c
assert c.s.y.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.v: B = None
        self.u: C = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

b.y = g
b.o = f
b.q = f
b.v = a
b.s = a
b.u = l
j.t = a
j.o = f
l.y = c
f.y = g
f.s = k
c.s = b
c.x = k
c.t = g
k.r = e
k.x = c
k.v = f
a.t = j
a.o = f
e.r = k
e.x = g
e.v = f
g.s = b
g.x = e
g.t = c
assert c.s.y.x.r.txt == "k"