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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.t: F = None
        self.w: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

k.x = c
k.y = g
f.p = g
f.t = g
f.q = c
f.w = b
f.v = b
c.r = e
c.u = e
c.v = f
c.y = f
e.s = g
b.w = k
b.r = f
b.x = e
g.p = k
g.s = e
j.r = e
j.u = e
j.v = f
j.y = f
m.x = j
m.y = g
assert m.y.p.y.p.x.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.t: F = None
        self.w: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

k.x = c
k.y = g
f.p = g
f.t = g
f.q = c
f.w = b
f.v = b
c.r = e
c.u = e
c.v = f
c.y = f
e.s = g
b.w = k
b.r = f
b.x = e
g.p = k
g.s = e
j.r = e
j.u = e
j.v = f
j.y = f
m.x = j
m.y = g
assert m.y.p.y.p.x.u.s.txt == "g"