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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.u: E = None
        self.o: F = None
        self.x: F = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

l = A("l")
m = B("m")
j = C("j")
n = D("n")
d = E("d")
f = F("f")
g = E("g")

l.s = j
l.p = j
m.y = d
m.v = j
m.w = j
m.u = g
m.o = f
m.x = f
j.v = m
n.t = m
n.x = f
d.o = f
f.u = j
f.o = j
f.q = g
f.p = m
f.w = l
g.o = f
assert d.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.u: E = None
        self.o: F = None
        self.x: F = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

l = A("l")
m = B("m")
j = C("j")
n = D("n")
d = E("d")
f = F("f")
g = E("g")

l.s = j
l.p = j
m.y = d
m.v = j
m.w = j
m.u = g
m.o = f
m.x = f
j.v = m
n.t = m
n.x = f
d.o = f
f.u = j
f.o = j
f.q = g
f.p = m
f.w = l
g.o = f
assert d.o.w.p.txt == "j"